#include<stdio.h>
#include <algorithm>
#include <iostream>
#include <cmath>
int Gcd(int a, int b) {
    while (a ^= b ^= a ^= b %= a);
    return b;
}
int main()  
{ std::cout << Gcd(77, 7);



    freopen("C:\\Users\\lenovo\\Desktop\\1.in", "r", stdin);
    freopen("C:\\Users\\lenovo\\Desktop\\1.out", "w", stdout);
     char a[60],b,c,n,i,j,q[60],w[60],e[60],r[60],o,p,k;
scanf("%d",&n);
for(i=1;i<=n;i++)
{o=0;
p=0;
b=0;
k=0;
scanf("%s",&a);
for(j=0;j<60;j++)
{if(a[j]>='a'&&a[j]<='z')
{q[j]=a[j];}
 if(a[j]==58)
 {j=j+3;
 break;}}
 for(j=j;j<60;j++)
 {if(a[j]>='0'&&a[j]<='9')
 {e[p]=a[j];
 p=p+1;}
 else if (a[j]==47)
 {j=j+1;
 break;
 }
 else if (a[j]==58)
 {j=j;
 }
 else
 {w[o]=a[j];
 o=o+1;}
 }
 for(j=j;j<60;j++)
 {r[b]=a[j];
 b=b+1;
 }
 if(e[0]==0)
 {e[0]='<';e[1]='d';e[2]='e';e[3]='f';e[4]='a';e[5]='u';e[6]='l';e[7]='t';e[8]='>';
 }
 if(r[0]==0)
 {r[0]='<';r[1]='d';r[2]='e';r[3]='f';r[4]='a';r[5]='u';r[6]='l';r[7]='t';r[8]='>';
 }
 printf("URL #%d\n",i);
 printf("Protocol = %s\n",q);
 printf("Host     = %s\n",w);
 printf("Port     = %s\n",e);
 printf("Path     = %s\n",r);
 printf("\n");
 for(c=0;c<60;c++)
 {q[c]='\0';
  w[c]='\0';
  e[c]='\0';
  r[c]='\0';
  a[c]='\0';
 }
}

 	return 0 ;
}
